<template>
  <div>
    <el-row>
      <el-col>
        <div class="top-img" v-if="topflag">
          <a href="javascript:">
            <img src="//image8.wbiao.co/mall/e83f8926954e4f51a87be989d0ea5504.jpg" />
          </a>
          <i class="el-icon-error del" @click="deltop"></i>
        </div>
      </el-col>
    </el-row>

    <el-row>
      <el-col class="top">
        <div class="top-left">
          <a href="javascript:">正品保障，免息分期！</a>
          <div class="top-rigth">
            <a href="javascript:" class="right1">请登录</a>
            <a href="javascript:" class="right1">注册即送3500元大礼包</a>
            <span>|</span>
            <a href="javascript:" class="right1">购物车</a>
            <a href="javascript:" class="custom right1" @mouseover="showservie" @mouseout="hideservice">客户服务
              <div class="service" v-show="service">
                <div class="line">
                  <dl>
                    <dd>客户顾问</dd>
                    <dd>帮助中心</dd>
                  </dl>
                  <dl>
                    <dd>售后维修</dd>
                    <dd>办理信用卡</dd>
                  </dl>
                </div>
                <p class="teltxt">服务专线：400-883-2688</p>
                <p class="teltxt">外呼号码：020-83931899</p>
              </div>

            </a>
            <a href="javascript:" class="right1">会员福利</a>
            <span>|</span>
            <a href="javascript:" class="right1">ENGLISH</a>
          </div>
          <div class="fix-navi">
            <ul>
              <li v-for="(item,index) in navilist" :key="index">
                <a href="javascript:" @mouseover="showfix(index)" @mouseout="hidefix(index)">
                  <i :class="{img:item.img}" :style="{'background-position':item.position}"></i>
                  <div class="text" v-show="item.textflag">
                    {{item.textname}}
                  </div>
                  <div class="code" v-show="item.code">
                    <a href="javascript:">
                      <img src="../assets/watch1.png" />
                    </a>
                     <p>下载万表App</p>
                  </div>
                </a>
              </li>
            </ul>
          </div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        topflag: true,
        service: false,
        width: "",
        height: "",
        navilist: [{
            img: true,
            textflag: false,
            position: "-507px -382px",
            textname: "购物车",
            code: false

          },
          {
            img: true,
            textflag: false,
            position: "-507px -246px",
            textname: "我的收藏",
            code: false

          },
          {
            img: true,
            textflag: false,
            position: "-469px -360px",
            textname: "浏览足迹",
            code: false

          },
          {
            img: true,
            textflag: false,
            position: "-373px -462px",
            textname: "浏览足迹",
            code: false
          },
          {
            img: true,
            textflag: false,
            position: "-507px -178px",
            textname: "返回顶部",
            code: false
          }

        ],
        img: ""

      }
    },
    components: {

    },
    methods: {
      deltop() {
        this.topflag = false
      },
      showservie() {
        this.service = true
      },
      hideservice() {
        this.service = false
      },
      showfix(index1) {
        this.navilist[index1].textflag = true
        if (index1 == 3) {
          this.navilist[index1].code = true
          this.navilist[index1].textflag=false
        } else {
          this.navilist[index1].code = false
          this.navilist[index1].textflag=true
        }
      },
      hidefix(index1) {
        this.navilist[index1].textflag = false
        if (index1 == 3) {
          this.navilist[index1].code = false
        }
      }


    }
  }
</script>

<style scoped="scoped">
  .top-img {
    position: relative;
  }

  .top-img a {
    display: block;
    background: #900d11;
  }

  .top-img a img {
    display: table;
    margin: 0 auto;
  }

  .top-img .del {
    position: absolute;
    top: 13px;
    right: 40px;
    font-size: 35px;
    background: #5c0a0c;
    color: #FFFFFF;
    cursor: pointer;
  }

  .top {
    background-color: #f4f4f4;
  }

  .top-left {

    position: relative;
    width: 1200px;
    margin: 0 auto;
    /* height: 100px; */
  }

  .top-left .fix-navi {
    /* border: 1px solid blue; */
    width: 100px;
    /* height: 100px; */
    position: fixed;
    top: 500px;
    right: 0;
    width: 44px;
    z-index: 4;
  }

  .top-left .fix-navi ul li {
    width: 44px;
    height: 44px;
    /* border: 1px solid black; */
  }

  .top-left .fix-navi ul li a {
    display: block;
    position: relative;
    height: 41px;
    margin: 0;
  }

  .top-left .fix-navi ul li a:hover {
    background-color: #f1f1f1;
  }

  .top-left .fix-navi ul li a .img {
    display: block;
    background-image: url(../assets/watch.png);
    background-size: 589px;
    width: 24px;
    height: 24px;
    position: absolute;
    top: 10px;
    left: 10px;
  }

  .top-left .fix-navi ul li a .text {
    /* border: 1px solid red; */
    position: absolute;
    right: 43px;
    width: 81px;
    height: 41px;
    line-height: 49px;
    text-align: right;
    background-color: #f1f1f1;
    color: #333;

  }

  .top-left .fix-navi ul li a .code {
    width: 200px;
    height: 210px;
    position: absolute;
    right: 43px;
    top: -123px;
    background-color: #f1f1f1;
  }

  .top-left .fix-navi ul li a .code a {
    display: block;
    width: 150px;
    height: 150px;
    margin: 0 auto;
  }

  .top-left .fix-navi ul li a .code a img {
    max-width: 100%;
  }
  .top-left .fix-navi ul li a .code p{
    text-align: center;
    padding-top: 10px;
    color: #333;
  }

  .top-left .fix-navi ul li a .text img {
    display: block;

  }

  .top-left a {
    color: #998c59;
    font-size: 12px;
    margin-left: 10px;
  }

  .top-rigth {
    /* height: 50px; */
    float: right;
  }

  .top-left .top-rigth a {
    margin-right: 9px;
  }

  .top-left .top-rigth span {
    color: #ddd;
  }

  .top-left .top-rigth .right1 {
    color: #999;
  }

  .top-left .top-rigth .right1:nth-child(2) {
    color: #ae0f17;

  }

  .top-left .top-rigth .right1:hover {
    color: #666;
    text-decoration: underline;
  }

  .top-left .top-rigth .right1:nth-child(2):hover {
    border-bottom: 1px solid #ae0f17;
    text-decoration: none;
    color: #ae0f17;
  }

  .top-left .top-rigth .custom {
    width: 50px;
    text-align: center;
  }

  .top-left .top-rigth .custom:hover {
    border-top: 1px solid #ccc;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    text-decoration: none;
    color: #333;
    background-color: #FFFFFF;
  }

  .top-rigth .custom {
    display: inline-block;
  }

  .top-rigth .custom .service {
    border: 1px solid blue;
    width: 220px;
    height: 173px;
    position: absolute;
    right: 165px;
    border: 1px solid #ccc;
    background-color: #FFFFFF;
    z-index: 3;
  }

  .top-rigth .custom .service .line {
    margin: 0 15px;
    height: 85px;
    border-bottom: 1px solid #eee;
  }

  .top-rigth .custom .service .line:after {
    content: "";
    display: table;
    clear: both;
  }

  .top-rigth .custom .service dl {
    padding-left: 21px;
    padding-top: 19px;
    float: left;
  }

  .top-rigth .custom .service dl dd {
    margin-bottom: 10px;
    color: #666;
  }

  .top-rigth .custom .service dl dd:hover {
    text-decoration: underline;
  }

  .top-rigth .custom .service .teltxt {
    text-align: center;
    padding-top: 15px;
    color: #999;
  }
</style>
